using JetBrains.Annotations;



namespace Crocodile.CsharpLanguage.Tree
{
    public class CsParameter : CsDatum
    {
        /// <summary>
        /// Direction of the parameter.
        /// </summary>
        public CsDirection Direction = CsDirection.In;

        public string Specification()
        {
            string dirprefix = Direction == CsDirection.Ref
                                   ? "ref "
                                   : Direction == CsDirection.Out 
                                        ? "out " 
                                        : "";
            string line = dirprefix + GetTypeDefForGenerating() + ' ' + Name;
            if (DefaultValue != null)
                line += " = " + DefaultValue;
            return line;
        }
    }
}